package com.designPattern.constructor;

/**
 * @author mxs
 * 【建造者模式】
 * 这里的对象是 【建造者的实现对象】 concreteBuildr对象
 * 【职责】负责实现如何初始化对象的方法
 */
public class CommonHouseBuilder extends HouseBuilder{
    @Override
    public void buildBasic() {
        System.out.println(house.getName() + "起地基:" + house.getBasicLength());
    }

    @Override
    public void roofed() {
        System.out.println(house.getName() + "封顶高度:" + house.getRoofLength());
    }

    @Override
    public House buildHouse() {
        house.setName("普通房子");
        house.setType("小洋楼");
        house.setBasicLength(20);
        house.setRoofLength(10);
        System.out.println(house.toString());
        buildBasic();
        roofed();
        return house;
    }
}
